<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
<link rel="shortcut icon" href="favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
       .radio-inline input[type=radio] {
            margin-top: 4px
        }
        .note-editable{height: 150px}
    </style>
</head>

<body style="color:#333;padding:3px;">
 <div class="page-heade">
      <h2 class="title_color text-center">网点基准销量补录</h2>
    </div>
    <div>
  <form method="get" class="form-inline" style="margin:10px">
    <table class="table-bordered table">
        <tr class="text-center info">
            <td style="font-size: 12px;">
               No.
            </td>
             <td style="font-size: 12px;">
               网点编号
            </td>
             <td style="font-size: 12px;">
               网点名称
            </td>
             <td style="font-size: 12px;">
               sku编号
            </td>
             <td style="font-size: 12px;">
               sku名称
            </td>
             <td style="font-size: 12px;">
              产品编号
            </td>
             <td style="font-size: 12px;">
              产品名称
            </td>
            {volist name="kaohearr" id="k"}
            <td  style="font-size: 12px;">{$k}月</td>
            {/volist}
        </tr>
        {volist name="pndet" id="pn" key="is"}
              <tr class="text-center">
                <td style="font-size: 12px;">
                   {$is}
                </td>
                 <td style="font-size: 12px;">
                   {$pn.net_no}
                </td>
                 <td style="font-size: 12px;">
                    {$pn.net_name}
                </td>
                 <td style="font-size: 12px;">
                    {$pn.sku_no}
                </td>
                 <td style="font-size: 12px;">
                    {$pn.sku_name}
                </td>
                 <td style="font-size: 12px;">
                   {$pn.pro_no}
                </td>
                 <td style="font-size: 12px;">
                   {$pn.pro_name}
                </td>
                {volist name="kaohearr" id="k"}
                <td  style="font-size: 12px;">
                    {volist name="needs" id="n"}
                        {if $n.pro_id==$pn.pro_id&&$n.net_id==$pn.net_id&&$n.kaoheqi2==$k}
                            <input type="num" class="jizhun form-control" style="width: 50px;padding: 0" pid="{$pn.pro_id}" nid="{$pn.net_id}" kid="{$k}"/>箱
                        {/if}
                    {/volist}
                </td>
                {/volist}
            </tr>
        {/volist}
    </table>
     <div class="row sub_btn white-bg" style="width:100%;text-align:center;padding: 20px 0">
    <input type="button" id="baocun" class="btn btn-success" value="保存">
       
    <input type="button" class="btn btn-warning" value="返回" id="fanhui">
    </div>
    <div style="color:red;font-size: 12px">
    说明:网点基准销量是指网点在没有做任何促销活动时候的自然销量
    </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
      <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
      <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <script>
   //  parent.layer.close(parent.layer.getFrameIndex(window.name))
    $("#fanhui").click(function(){
        parent.layer.close(parent.layer.getFrameIndex(window.name))
    })
    $("#baocun").click(function(){
        var flag=0;
        $(".jizhun").each(function(){
            if($(this).val()==""||$(this).val()<=0){
                flag=1;return false;
            }
        })
        if(flag==1){
              swal({
                        title: "错误",
                        text:  "基准销量必须填写完成，且必须大于0",
                        type: "warning"
                    });
        }else{
            var i=0;var pids=[];var nids=[];var kids=[];var vals=[];
            $(".jizhun").each(function(){
                pids[i]=$(this).attr("pid");nids[i]=$(this).attr("nid");kids[i]=$(this).attr("kid");vals[i]=$(this).val();
                i++;
            })
            var pstr=pids.join(',');
            var nstr=nids.join(',');
            var kstr=kids.join(',');
            var vstr=vals.join(',');
            var jid={$jid};
            $.post("{:url('addjizhun')}",{pstr:pstr,nstr:nstr,kstr:kstr,vstr:vstr,jid:jid},function(re){
                if(re==1){
                     swal({
                        title: "完成",
                        text:  "操作已成功",
                        type: "success"
                    },
                    function(){
                         parent.layer.close(parent.layer.getFrameIndex(window.name))
                    });
                }else{
                      swal({
                        title: "错误",
                        text:  "系统繁忙请稍后再试",
                        type: "warning"
                    });
                }
            })
        }
    })
    </script>
</body>

</html>
